package com.af.dao.pay.impl;

import java.sql.SQLException;

import com.af.common.CommonUtil;
import com.af.common.DBHelper;

public class ValPayState {
	private DBHelper dh = null;
	/**
	 * 判断订单是否进行过相同操作
	 * @param orderId
	 * @param serviceId
	 * @return
	 */
	public boolean valPayResponse(String orderId,String serviceId){
		boolean flag = true;
		dh = DBHelper.getInstance();
		try {
			String sql = "{call valPayResponseState(?,?)}";
			Object[] args = new Object[]{orderId,serviceId};
			Object obj_item = dh.query(sql,args);
			if(CommonUtil.isNotNullOrEmpty(obj_item)){
				flag=false;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{dh.close();}
		return flag;
	}
}
